<!doctype html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>登陆界面</title>
  <meta name="description" content="这是一个 index 页面">
  <meta name="keywords" content="index">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="icon" type="image/png" href="assets/i/favicon.png">
  <link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">
  <meta name="apple-mobile-web-app-title" content="Amaze UI" />
  <link rel="stylesheet" href="assets/css/amazeui.min.css" />
  <link rel="stylesheet" href="assets/css/admin.css">
  <link rel="stylesheet" href="assets/css/app.css">
</head>

<body data-type="login">

  <div class="am-g myapp-login">
	<div class="myapp-login-logo-block  tpl-login-max">
		<div class="myapp-login-logo-text">
			<div class="myapp-login-logo-text">
				周报系统<span> 登陆界面</span> <i class="am-icon-skyatlas"></i>
				
			</div>
		</div>

		<div class="login-font">
			<i>登陆 </i> / <span> 注册</span>
		</div>
		<div class="am-u-sm-10 login-am-center">
			<form class="am-form">
				<fieldset>
					<div class="am-form-group">
						<input type="text" class="account" id="account" placeholder="输入账户">
					</div>
					<div class="am-form-group">
						<input type="password" class="pass" id="password" placeholder="输入密码">
					</div>
					<p><button type="submit" class="am-btn am-btn-default" id="loginbtn">登录</button></p>
				</fieldset>
			</form>
		</div>
	</div>
</div>

  <script src="assets/js/jquery.min.js"></script>
  <script src="assets/js/amazeui.min.js"></script>
  <script src="assets/js/app.js"></script>
  <script type="text/javascript">
  $(document).ready(function(){
  		$("button").click(function(){
  	  		var account = $(".account").val();
  	  		var pass = $(".pass").val();
 			$.ajax ({
  				url : "http://localhost:8800/week_report/my/login",
  				type : "post",
  				data :
			    {
			        "account" : account,
			        "pass" : pass
			    },
  				success : function (data)
  				{
  	  				var grade = data.data.u_grade;
  	  				if(grade==1)
  	  	  			{
  	  					location.href ="http://localhost:8800/week_report/views/grade1.html";
  	  	  	  		}
  	  				else if(grade==2)
  	  				{
  	  					location.href ="http://localhost:8800/week_report/views/grade2.html";
  	  	  			}
  	  				else if(grade==3)
  	  				{
  	  					location.href ="http://localhost:8800/week_report/views/grade3.html";
  	  	  			}
  				}
  			});
 			alert("success");
  	  });
   });
  </script>
</body>

</html>